package com.castle.fortress.admin.flowable.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.castle.fortress.admin.flowable.entity.FlowableTemplateEntity;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;
/**
 * 流程模板管理表Mapper 接口
 *
 * @author castle
 * @since 2022-09-26
 */
public interface FlowableTemplateMapper extends BaseMapper<FlowableTemplateEntity> {

	List<FlowableTemplateEntity> queryList(@Param("map")Map<String, Long> pageMap, @Param("flowableTemplateEntity") FlowableTemplateEntity flowableTemplateEntity);
	List<FlowableTemplateEntity> extendsList(@Param("map")Map<String, Long> pageMap, @Param("flowableTemplateEntity") FlowableTemplateEntity flowableTemplateEntity);
	/**
	 * 扩展信息记录总数
	 * @param flowableTemplateEntity
	 * @return
	 */
	Long extendsCount(@Param("flowableTemplateEntity") FlowableTemplateEntity flowableTemplateEntity);
	/**
	 * 扩展详情
	 * @param id
	 * @return
	 */
	FlowableTemplateEntity getByIdExtends(@Param("id")Long id);

	/**
	 * 查询已部署未绑定的流程
	 * @return
	 */
	List<FlowableTemplateEntity> unbindFlowableTemplate();

    void removeByAppIds(@Param("ids")List<Long> ids);

	long isBind(@Param("id") Long id);

    List<FlowableTemplateEntity> listFlowableTemplateIgnoreDel(@Param("flowableTemplateEntity") FlowableTemplateEntity flowableTemplateEntity);

	FlowableTemplateEntity getByIdIgnoreDel(@Param("id")String fid);
}
